package plugin;

import java.util.Comparator;

public class PlatformComparator implements Comparator<PlatformTrain> {
	private String name;

	protected PlatformComparator(String platform_name) {
		this.name = platform_name;
	}

	@Override
	public int compare(PlatformTrain one, PlatformTrain two) {
		int result = 0;
		try {
			result = (int) ((one.getTrain().plan.getStopEntry(name).an + (one.getTrain().verspaetung * 1000 * 60)) - (two
					.getTrain().plan.getStopEntry(name).an + ((two.getTrain().verspaetung * 1000 * 60))));
		} catch (Exception e) {
		}

		return result;
	}
}
